import akshare as ak

# # 财务报表-新浪
# stock_financial_report_sina_df = ak.stock_financial_report_sina(stock="sz002304", symbol="资产负债表")
# print("财务报表-新浪")
# print(stock_financial_report_sina_df.keys())
# print(stock_financial_report_sina_df.tail(2))

# # 财务报表-东财
# stock_balance_sheet_by_report_em_df = ak.stock_balance_sheet_by_report_em(symbol="SZ002304")
# print("财务报表-东财")
# print(stock_balance_sheet_by_report_em_df.keys())
# print(stock_balance_sheet_by_report_em_df.tail(2))

# # 财务报表-同花顺
# stock_financial_debt_ths_df = ak.stock_financial_debt_ths(symbol="002304", indicator="按年度")
# print("财务报表-同花顺")
# print(stock_financial_debt_ths_df.keys())
# print(stock_financial_debt_ths_df.tail(2))


# stock_financial_abstract_df = ak.stock_financial_abstract(symbol="002304")
# print("关键指标-新浪")
# print(stock_financial_abstract_df.keys())
# print(stock_financial_abstract_df)


stock_financial_abstract_df = ak.stock_financial_abstract(symbol="002304")
print("关键指标-新浪")
print(stock_financial_abstract_df.keys())
print(stock_financial_abstract_df)
# stock_financial_abstract_df.to_excel("关键指标-新浪.xlsx")

# indicator="按报告期"; choice of {"按报告期", "按年度", "按单季度"}
stock_financial_abstract_ths_df = ak.stock_financial_abstract_ths(symbol="002304", indicator="按年度")
print("关键指标-同花顺")
print(stock_financial_abstract_ths_df.keys())
print(stock_financial_abstract_ths_df)

stock_financial_analysis_indicator_df = ak.stock_financial_analysis_indicator(symbol="002304", start_year="2006")
print("财务指标")
print(stock_financial_analysis_indicator_df)
# stock_financial_analysis_indicator_df.to_excel("财务指标.xlsx")